#include "widget.h"
#include "ui_widget.h"
#include <QTimer>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
     t=new QTimer(this);
    connect(t,&QTimer::timeout,this,&Widget::solve);
    t->start(1000);

    ui->lcdNumber->display(10);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::solve()
{
    int value=ui->lcdNumber->value();
    if(value==0)
        t->stop();
    ui->lcdNumber->display(value-1);
}

